package com.qianxing.controller;

import com.qianxing.service.TbNationLanguagePackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author:JasonLong
 * Date:2023/5/12
 * Time:0:45
 * 民族方言语音包页面控制类
 */
@Api(value = "民族方言语音包控制类")
@RestController
@RequestMapping("/wx/nation")
public class WxNationDialectPageController {

    @Autowired
    private TbNationLanguagePackService nationalDialectPageService;

    /**
     * @param nationFlag
     * @return List
     * 该接口提供民族方言数据
     * 需要的参数是民族(nationFlag)
     */
    @ApiOperation(value = "民族方言数据接口")
    @ApiImplicitParam(name = "nationFlag", value = "民族标记参数", dataType = "String", paramType = "query")
    @GetMapping("/nationList")
    public List getNationLanguagePack(@RequestParam String nationFlag) {
        return nationalDialectPageService.getNationLanguagePack(nationFlag);
    }

    @ApiOperation(value = "民族方言查询接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "keyword", value = "搜索关键字", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "nationFlag", value = "民族标记参数", dataType = "String", paramType = "query")
    })
    @GetMapping("/nationQuery")
    public List getNationDataByKeyword(String keyword, String nationFlag) {
        return nationalDialectPageService.getNationDataByKeyword(keyword, nationFlag);
    }


    @GetMapping("/getAll")
    public List getAll() {
        return nationalDialectPageService.getAll();
    }
}
